package creditsProject.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Logger;

import creditsProject.server.dao.RequestDao;
import creditsProject.server.dao.impl.CreditDaoImpl;
import creditsProject.server.dao.impl.RequestDaoImpl;
import creditsProject.server.dao.impl.ManagerDaoImpl;
import creditsProject.server.services.impl.ManagerServiceImpl;

public class MainServer {
	static ManagerDaoImpl ManagerDao = new ManagerDaoImpl();
	static ManagerServiceImpl managerService = new ManagerServiceImpl();
	static RequestDaoImpl requestDao = new RequestDaoImpl();
	static CreditDaoImpl creditDao = new CreditDaoImpl();

	public static void main(String[] args) {

		try {
			ServerSocket servSocket = new ServerSocket(32167);
			System.out.println("server started at port: " + 32167);

			while (true) {
				Socket socket = servSocket.accept();
				new Thread(new ServerThread(socket)).start();
				System.out.println("New Client connected");
			}

		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
